package cj.web.yc.service;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cj.web.yc.dao.CategoryDAO;

@Service
public class CategoryService {

	@Autowired
    private CategoryDAO categoryDAO;
	
	/**
	 * 查询类目——第一层
	 * @param id
	 * @param pid
	 * @return
	 */
	public List<Map> queryByIdandPid(int id,int pid){
		return categoryDAO.queryByIdandPid(id, pid);
	}
	
	/**
	 * 查询类目——子节点
	 * @param pid
	 * @return
	 */
	public List<Map> queryByPid(int pid){
		return categoryDAO.queryByPid(pid);
	}
}